package com.zfzs.post.modules.agent.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 用户详细信息
 *
 * @author ck
 * @date 2019-08-07
 */
@Entity
@Data
@Table(name = "agent_info")
public class AgentInfo implements Serializable {

    // 主键id
    @Id
    @Column(name = "id")
    private Long id;

    // 昵称
    @Column(name = "nick_name")
    private String nickName;

    // 头像图片id
    @Column(name = "head_img_id")
    private Long headImgId;

    // 邮箱
    @Column(name = "email")
    private String email;

    // 性别  0：男 1：女
    @Column(name = "sex")
    private Integer sex;

    // 用户来源 1：用户扫码推荐
    @Column(name = "user_source")
    private Integer userSource;

    // 个人签名
    @Column(name = "personal_descs")
    private String personalDescs;

    // 创建日期
    @Column(name = "create_time")
    private Timestamp createTime;

    // 修改时间
    @Column(name = "update_time")
    private Timestamp updateTime;

    // 最后一次活跃时间
    @Column(name = "last_source_time")
    private Timestamp lastSourceTime;

    public void copy(AgentInfo source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}